home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
AVOGADRO
/
NEW
/
SIMPSON
/
!Simpson
/
Docs
/
Manual
next >
Wrap
Text File
|
1996-04-04
|
6KB
|
135 lines
ABOUT THIS PROGRAM
---------------------------------------------------------------------------
Name : Simpson
Version : 1.00 (10 Mar 1996)
Purpose : Approximate integration using Simpson's Rule
Author : © Andrew Berry, 1996
Licence : Freeware. Please see conditions at the end of this file.
Simpson supports Interactive Help.
PURPOSE
---------------------------------------------------------------------------
Simpson is a program to calculate integrals using Simpson's rule. Although
Simpson's rule is, in theory, an approximate method, it is usually accurate
to 2 or 3 significant figures when 3 or 5 ordinates are used, becoming
accurate to about the 6th significant figure when using many more
ordinates.
This program will be useful when calculating the integrals of functions
which you are unable to integrate. You could use Simpson's rule by hand,
but this becomes very tedious for any more than 5 or 7 ordinates,
restricting accuracy to around 3 significant figures. The results given
by this program are certainly comparable to those obtained by most
graphical calculators. Indeed, the CASIO fx-9700GE actually uses Simpson's
rule for calculating integrals, but takes much longer than this program!
It can, however, use up to 512 ordinates, a feature which I'm planning to
add in the future.
USING
---------------------------------------------------------------------------
The main window is opened by clicking on the Simpson icon on the icon bar.
The top of the window shows the symbols used to represent the limits and
the function itself. The answer will appear to the right of this.
Apologies for the quality of the display in medium resolution modes, but
I was unable to represent the necessary notation using the system font.
The function to be integrated is entered in the first writeable icon. It
should be a function in x, entered using lower case 'x' thoughout, in a
format understood by the Basic EVAL command. This can be summarised by
the following table.
Term to be entered Enter as.....
==========================================================
2x 2*x
x² x^2
(x+3)(x+5) (x+3)*(x+5)
root x x^0.5
sin x SINx [ x in radians ]
|x| ABSx
pi PI
log x LOGx
ln x LNx
e^x EXPx
I think this covers everything! The limits for the integral are entered
in the two writeable icons below, x0 being the lower limit and xn being the
upper limit. The number of ordinates determines the accuracy of the answer,
although 3 to 9 is usually adequate, giving at least 3 s.f. accuracy. The
number of ordinates, odd only, can be altered using the arrows.
Once the values have been entered, click on Calculate or press Return in
the last writeable icon, and the answer will appear at the top of the
window.
For certain functions, accuracy may decrease very slightly as the number of
ordinates increases. For example, f(x)=x³ from -10 to 10 gives 0 (as
expected) with 3 or 5 ordinates, but gives a very small negative value
(around 1E-6) for higher numbers of ordinates. This is due to the fact that
Simpson's rule is only an approximation - as far as I know this isn't a
failure of the program, but I'm not working out the result by hand with 99
ordinates just to make sure! It's possible that rounding errors are being
introduced by the use of EVAL and STR$, but I don't know a way round this
and any error won't be significant for most situations.
HISTORY
---------------------------------------------------------------------------
1.00 (10 Mar 1996) : • The first version.
FOR A FUTURE VERSION
---------------------------------------------------------------------------
• Allow limits to be entered as expressions as well as numbers. This will
enable, for instance, an upper limit of PI or ln 3 to be used rather than
the somewhat inaccurate 3.1415927 or 1.0986123.
• Add support for more (up to 512) ordinates.
DISTRIBUTION NOTES
---------------------------------------------------------------------------
This program is Freeware, NOT public domain. This means that I retain the
copyright but give everyone the right to distribute it by any means, as
long as all files are supplied and I am fully credited.
If you would like to include this program on a magazine cover disc then
please contact me first to obtain the latest version. If you run a PD
library and did not obtain this program from me, then you may like to write
and I'll send you the latest versions of all my programs followed by
regular updates as they become available.
PLEASE NOTE
---------------------------------------------------------------------------
Although this program has been fully tested, I (the author) cannot be held
responsible for any loss or damage caused by the use or misuse of this
program. It is used entirely at your own risk.
CONTACT
---------------------------------------------------------------------------
Please write to me at the address below. I would be interested to hear if
you have ideas for improving the program or have found any bugs.
New versions of all my programs are always sent first to APDL and
The Datafile or can be obtained by writing to the below address, enclosing
either a cheque for £1.00 or a disc and return postage.
The file !Simpson.Docs.Others contains details of my other programs.
Please write to:
Andrew Berry
39 Lancaster Avenue
Sandiacre
Nottingham
NG10 5GW
---------------------------------------------------------------------------